package com.wxtt.android.crash;

import android.widget.Toast;

import com.fast.dev.frame.utils.CrashHandler;
import com.fast.dev.frame.utils.LogUtils;
import com.wxtt.android.config.ApiConfig;

import java.io.File;

/**
 * 说明：崩溃处理器
 * <p/>
 * 作者：fanly
 * <p/>
 * 时间：2015/12/26 10:47
 * <p/>
 * 版本：verson 1.0
 */
public class MyCrashHandler extends CrashHandler{

    private static MyCrashHandler handler = null;

    private MyCrashHandler(){}

    public static MyCrashHandler getInstance(){
        if (handler == null){
            handler = new MyCrashHandler();
        }
        return handler;
    }

    @Override
    public Thread.UncaughtExceptionHandler setHandler() {
        return this;
    }

    @Override
    public void show() {
        Toast.makeText(mContext,"很抱歉，程序崩溃了.",Toast.LENGTH_LONG).show();
    }

    @Override
    public void upLog(File file) {
        ApiConfig.uploadBmobFile(file);
    }
}
